Joshua Alley
Replication instructions for: 
Arms and Elections: Arms and Elections: Arms Deals with Autocracies, Defense Contracting and U.S. Presidential Elections

This zip file contains replication materials, including both data construction and analysis. 

The most straightforward way to replicate everything is to download the zip file onto your machine, and extract everything into a common directory.

Then, open the .Rproj file, and from the data foler, use do-all.R to run everything.

If you want to run analyses separately, do-all.R also shows the proper order for running the data cleaning and analysis scripts.

Further script details are:
To set up functions and packages, as well as a seed: 
data/setup-script.R

Data Cleaning- 
data/data-cleaning
data/clean-state-data.R

Analysis of Arms Deals and Presidential Elections 
data/us-arms-deals-raw.R
data/us-arms-deals.R
data/deals-robustness-check.R

Analyses of Defense Contracting and Arms Deals
data/joint-est-raw
data/joint-est.R

Analyses by Sector
data/sector-analysis.R

Additional Checks
data/other-democracies.R
data/interactions-check.R

Variable descriptions and sources are available in the online appendix. 